﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeFile="SpaceMaterial_Add.aspx.cs" Inherits="Web_Admin_SpaceMaterial_SpaceMaterial_Add" %>

<%@ Register src="../ascx/navigation.ascx" tagname="navigation" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>空间素材添加</title>
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../css/default.css" />
    <link rel="stylesheet" type="text/css" href="../fancybox/jquery.fancybox-1.3.1.css" />
    <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="../js/jquery.validate.js"></script>
    <script type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../fancybox/jquery.fancybox-1.3.1.pack.js"></script>
    <script type="text/javascript">
        //预览图片
        $(document).ready(function () {
            $("a#example").fancybox({
                'titleShow': false,
                'transitionIn': 'elastic',
                'transitionOut': 'elastic'
            });
        });
        var upload_reg = /\.(jpg|jpeg|gif|png)/i;
        var filename_reg = /:|\/|\|\*|\?|"|<|>|\|/i;
        //方法
        $.validator.addMethod(
            "uploadimg_validate",
            function (value, element) {
                if ($.trim(value) == "") {
                    return true;
                }
                return upload_reg.test($.trim(value));
            },
            "上传图片后缀必须为(jpg|jpeg|gif|png)"
        );
        //验证
        $().ready(function() {
            $("#form1").validate({
                rules: {
                    txt_UserID: { required: true },
                    txt_Name: { required: true },
                    file_uploadimage: { uploadimg_validate: true },
                    txt_UpNum: { required: true },
                    txt_DownNum: { required: true },
                    txt_AddTime: { required: true }              
                },
                messages: {
                    txt_UserID: { required: "会员ID不能为空" },
                    txt_Name: { required: "图片名称不能为空" },
                    txt_UpNum: { required: "顶数不能为空" },
                    txt_DownNum: { required: "踩数不能为空" },
                    txt_AddTime: { required: "添加时间不能为空" }              
                },
                errorElement: "em",
                errorPlacement: function(error, element) {
                    error.appendTo(element.parent());
                }
            });
        });
    </script>
</head>
<body>
<form id="form1" runat="server">
<uc1:navigation ID="navigation1" Title="空间素材添加" runat="server" />
<div class="adRbox">
    <div class="arTabBox arFmtd">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <th class="fmth"><asp:Literal ID="lit_title" Text="空间素材添加" runat="server"></asp:Literal></th>
            <th>&nbsp;</th>
          </tr>
          <tr>
            <td class="addtd">语言：</td>
            <td>
                <asp:DropDownList ID="drpLang" DataTextField="name" DataValueField="namekey" runat="server">
                </asp:DropDownList>
            </td>
          </tr>
          <tr>
            <td class="addtd">会员ID：</td>
            <td><asp:TextBox ID="txt_UserID" CssClass="ipt1" runat="server"></asp:TextBox>&nbsp;<em>*</em>&nbsp;</td>
          </tr>
          <tr>
            <td class="addtd">分类ID：</td>
            <td><asp:CheckBoxList ID="chk_Classification" RepeatLayout="Flow" RepeatColumns="6" DataTextField="ClassName" DataValueField="ID" runat="server">
                </asp:CheckBoxList>
                &nbsp;&nbsp;</td>
          </tr>
          <tr>
            <td class="addtd">色系ID：</td>
            <td><asp:CheckBoxList ID="chk_Color" RepeatLayout="Flow" RepeatColumns="6" DataTextField="ClassName" DataValueField="ID" runat="server">
                </asp:CheckBoxList>
                &nbsp;&nbsp;</td>
          </tr>
          <tr>
            <td class="addtd">图片名称：</td>
            <td><asp:TextBox ID="txt_Name" CssClass="ipt1" runat="server"></asp:TextBox>&nbsp;<em>*</em>&nbsp;</td>
          </tr>
          <tr>
            <td class="addtd">简介：</td>
            <td><asp:TextBox ID="txt_Intro" CssClass="ipt3" TextMode="MultiLine" Rows="5" Columns="48" runat="server"></asp:TextBox>&nbsp;&nbsp;</td>
          </tr>
          <tr>
            <td class="addtd">图片：</td>
            <td><asp:Literal ID="lit_img_Pic" runat="server"></asp:Literal></td>
          </tr>
          <tr>
            <td class="addtd">上传图片：</td>
            <td><asp:FileUpload ID="file_uploadimage" CssClass="ipt3" Width="263px" runat="server" />&nbsp;&nbsp;<em>注：上传图片尺寸(92X62)</em></td>
          </tr>
          <tr>
            <td class="addtd">图片地址：</td>
            <td><asp:TextBox ID="txt_Pic" CssClass="ipt1" runat="server"></asp:TextBox>&nbsp;&nbsp;</td>
          </tr>
          <tr>
            <td class="addtd">顶数：</td>
            <td><asp:TextBox ID="txt_UpNum" CssClass="ipt1" runat="server"></asp:TextBox>&nbsp;<em>*</em>&nbsp;</td>
          </tr>
          <tr>
            <td class="addtd">踩数：</td>
            <td><asp:TextBox ID="txt_DownNum" CssClass="ipt1" runat="server"></asp:TextBox>&nbsp;<em>*</em>&nbsp;</td>
          </tr>
          <tr>
            <td class="addtd">添加时间：</td>
            <td><asp:TextBox ID="txt_AddTime" CssClass="ipt1" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" runat="server"></asp:TextBox>&nbsp;<em>*</em>&nbsp;</td>
          </tr>
          <tr>
            <td class="addtd">&nbsp;</td>
            <td class="fmBtns"><label>
                <asp:Button ID="But_Save" runat="server" Text="保存" onclick="But_Save_Click" />
                <asp:Button ID="But_AsSave" runat="server" Text="另存为" onclick="But_AsSave_Click" />
                <input type="button" name="button3" id="button3" value="返回" onclick="history.back();" />
            </label></td>
          </tr>
        </table>
    </div>
</div>
</form>
</body>
</html>
